package com.xiahui.day01;

/**
 * 四种整数类型
 * byte  1个字节8位 -128~127
 * short 2个字节16位 -32768~32767
 * int   4个字节32位 -2147483648 ~2147483647
 * long  8个字节64位
 */
public class TestNumberType {
    public static void main(String[] args) {
        byte b1 = 100;
        System.out.println("b1的取值为：" + b1);

        byte b2 = -123;
        System.out.println("b2 = " + b2);

//        byte b3=-129;
//        System.out.println("b3 = " + b3);
        System.out.println("..............................................................");

        short s1 = 8956;
        System.out.println("s1 = " + s1);

        short s2 = -23451;
        System.out.println("s2 = " + s2);

//        short s3=-32769;
//        System.out.println("s3 = " + s3);
        System.out.println("----------------------------------------------------------------");

        int i1 = 895645;
        System.out.println("i1 = " + i1);

        int i2 = -561245;
        System.out.println("i2 = " + i2);

//        int i3=2147483648;
        System.out.println("----------------------------------------------------------------");


        //int为整数的默认类型，如果需要为long类型赋值
        //如果超出了int 则需要在值的后面追加“L”
        //如果在int范围以内 则可加可不加
        long l1 = 567854651;
        System.out.println("l1 = " + l1);

        long l2 = -45127856;
        System.out.println("l2 = " + l2);

        long l3 = 217483648L;
        System.out.println("l3 = " + l3);
//        long l4=2174836499;

        System.out.println("-------------------------------------------------");

        char ch1 = 'a';
        System.out.println("ch1 = " + ch1);

        char ch2 = 126;
        System.out.println("ch2 = " + ch2);

        char ch3 = 20013;
        System.out.println("ch3 = " + ch3);

        char ch4='中';
        System.out.println("ch4 = " + ch4);

        char ch5='\u4e2d';
        System.out.println("ch5 = " + ch5);
    }
}
